<?php

namespace app\api\controller;

use app\common\controller\Api;
use app\common\model\Category as CategoryModel;


class Category extends Api
{
    protected $noNeedLogin = '*';
    protected $noNeedRight = '*';

    public function list()
    {
        $type = $this->request->param('type');
        if (empty($type)) {
            $list = [];
        } else {
            $list = CategoryModel::getCategoryArray($type, 'normal');
        }
        $ret = [
            'entries' => $list,
        ];
        $this->success('返回成功', $ret);
    }
}
